#pragma once
#include <iostream>
#include <vector>
#include <codecvt>
#include <algorithm> 
#include <string> 
#include <functional>
#include <iterator>
using namespace std;

class STRING_DLL_API StringTools
{

public:
	static StringTools* instance() {
		return tools_;
	}

	std::string UnicodeToUTF8(const std::wstring& wstr);

	std::wstring UTF8ToUnicode(const char* str);

	std::string UnicodeToANSI(const std::wstring& wstr);

	std::wstring ANSIToUnicode(const std::string& str);

	std::string UTF8ToANSI(const std::string& str);

	std::string ANSIToUTF8(const std::string& str);

	std::string StringToUpper(const std::string& source);

	std::string StringToLower(const std::string& source);

	int StringToInt(const std::string& source);

	bool StringToBool(const std::string& source);

	char* StringToArray(const std::string& str);

	std::string StringFromInt(int source);

	std::vector<std::string> StringSplit(const std::string& source, const std::string& interval);

	std::string DeleteSpecString_One(const std::string& source , const char& specstr);

	std::string DeleteSpecString_All(const std::string& source, const char& specstr);

	std::string DeleteSpecString_All(const std::string& source, const std::string& specstr);

	std::string DeleteSpecString_Left(const std::string& source, const std::string& specstr);

	std::string DeleteSpecString_Right(const std::string& source, const std::string& specstr);

	std::string ReplaceSpecString_First(const std::string& source, const std::string& specstr, const std::string& target);

	std::string ReplaceSpecString_Last(const std::string& source, const std::string& specstr,const std::string& target);

	std::string ReplaceSpecString_All(const std::string& source, const std::string& specstr,const std::string& target);

private:
	StringTools() {}
	~StringTools() {}
	static StringTools* tools_;

};

